package com.ouyeel.domain;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;

import java.io.Serializable;
import java.text.ParseException;
import java.util.Date;
import java.util.List;

/**
 * Created by SNK on 2016/9/2.
 */
public class RfqSupplierListVo implements Serializable {
    private static final long serialVersionUID = 1L;
    private String id ;//主键
    private String companyId ;//注册公司ID
    private String supplierName ;//供应商名称
    private String linkmanName ;//联系人姓名
    private String linkmanTelphone ;//联系人电话
    private String quotationIp;//报价ip


    //发起多轮的字段
    private Long quotationRound;	//当前轮次
    private String requestId;	//询单ID
    private String supplierCode;	//供应商代码
    private String clarificationInviteSupplier;	//邀请供应商
    private String memo;	//备注
    private String deviceDealerGrade;	//供应商等级
    private String unifiedRfqNum;//方便页面取
    private String title;	//询单标题
    private String assureFlag ;//是否交保证金
    private String quotationDate ;//报价时间
    private String ip;//IP地址，搜索-rfq quotation
    private String responseFlag;	//响应标识
    private String quotationStatus;	//状态同STATUS字段
    private String recCreateTime;	//创建时间
    private String tenderFlag;	//是否已购买标书（0未交 1 已交）
    private String seq;	//页面排序
    private String reCognizanceNo;	//扣款流水号
    private String responseTime;	//响应时间
    private String exchangeNo;	//资金平台流水号
    private String dealerAssistantCode;	//供应商附码(For BPMS竞标)
    private String refundMentNo;	//退款流水号
    private String companyNum;	//注册公司代码
    private String isBindWechat;	//微信状态A
    private String tenderNo;	//购买标书流水号
    private String status;	//10未生成报价单 40已生成 50代表未审批供应商 60草稿70驳回
    private String subtotalTaxed;   //询单总价
    private String quotationGiveUpMemo; //放弃报价说明

    private String giveUpReason;//放弃原因
    private String giveUpMemo;//放弃说明
    private String giveUpDate;//放弃时间

    //--------------
    //供应商缴纳审核列表详情添加字段
    private String assureOrTenderPayDate;//缴纳时间
    private String assureOrTenderMoney;//金额
    private String rfqFinancialStatus;//财务状态
    //-------------

    //多伦报价审批添加字段
    private String rowno;//序号

    private RfqQuotationVo quotation;
    private List<RfqQuotationHisotryVo> quotationHisotrys;



    public String getRowno() {
        return rowno;
    }

    public void setRowno(String rowno) {
        this.rowno = rowno;
    }

    public String getAssureOrTenderPayDate() {
        return assureOrTenderPayDate;
    }

    public void setAssureOrTenderPayDate(String assureOrTenderPayDate) {
        this.assureOrTenderPayDate = assureOrTenderPayDate;
    }

    public String getAssureOrTenderMoney() {
        return assureOrTenderMoney;
    }

    public void setAssureOrTenderMoney(String assureOrTenderMoney) {
        this.assureOrTenderMoney = assureOrTenderMoney;
    }

    public String getRfqFinancialStatus() {
        return rfqFinancialStatus;
    }

    public void setRfqFinancialStatus(String rfqFinancialStatus) {
        this.rfqFinancialStatus = rfqFinancialStatus;
    }

    public String getGiveUpReason() {
        return giveUpReason;
    }

    public void setGiveUpReason(String giveUpReason) {
        this.giveUpReason = giveUpReason;
    }

    public String getGiveUpMemo() {
        return giveUpMemo;
    }

    public void setGiveUpMemo(String giveUpMemo) {
        this.giveUpMemo = giveUpMemo;
    }

    public String getGiveUpDate() {
        return giveUpDate;
    }

    public void setGiveUpDate(String giveUpDate) {
        this.giveUpDate = giveUpDate;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getSupplierCode() {
        return supplierCode;
    }

    public void setSupplierCode(String supplierCode) {
        this.supplierCode = supplierCode;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public String getLinkmanName() {
        return linkmanName;
    }

    public void setLinkmanName(String linkmanName) {
        this.linkmanName = linkmanName;
    }

    public String getLinkmanTelphone() {
        return linkmanTelphone;
    }

    public void setLinkmanTelphone(String linkmanTelphone) {
        this.linkmanTelphone = linkmanTelphone;
    }

    public String getAssureFlag() {
        return assureFlag;
    }

    public void setAssureFlag(String assureFlag) {
        this.assureFlag = assureFlag;
    }

    public String getQuotationDate() {
        return dateFormat(quotationDate);
    }

    public void setQuotationDate(String quotationDate) {
        this.quotationDate = quotationDate;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Long getQuotationRound() {
        return quotationRound;
    }

    public void setQuotationRound(Long quotationRound) {
        this.quotationRound = quotationRound;
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public String getClarificationInviteSupplier() {
        return clarificationInviteSupplier;
    }

    public void setClarificationInviteSupplier(String clarificationInviteSupplier) {
        this.clarificationInviteSupplier = clarificationInviteSupplier;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public String getDeviceDealerGrade() {
        return deviceDealerGrade;
    }

    public void setDeviceDealerGrade(String deviceDealerGrade) {
        this.deviceDealerGrade = deviceDealerGrade;
    }


    public String getUnifiedRfqNum() {
        return unifiedRfqNum;
    }

    public void setUnifiedRfqNum(String unifiedRfqNum) {
        this.unifiedRfqNum = unifiedRfqNum;
    }

    private String dateFormat (String date){
        String result = "";
        if(StringUtils.isNotBlank(date)){
            Date newDate = null;
            try {
                newDate = DateUtils.parseDate(date, "yyyy-MM-dd HH:mm:ss.SSS");
            } catch (ParseException e) {
                try {
                    newDate = DateUtils.parseDate(date, "yyyy-MM-dd HH:mm:ss");
                } catch (ParseException e1) {
                    return result;
                }
            }
            result = DateFormatUtils.format(newDate,"yyyy-MM-dd HH:mm");
        }else {
            result = "";
        }
        return result;
    }

    public String getResponseFlag() {
        return responseFlag;
    }

    public void setResponseFlag(String responseFlag) {
        this.responseFlag = responseFlag;
    }

    public String getQuotationStatus() {
        return quotationStatus;
    }

    public void setQuotationStatus(String quotationStatus) {
        this.quotationStatus = quotationStatus;
    }

    public String getRecCreateTime() {
        return recCreateTime;
    }

    public void setRecCreateTime(String recCreateTime) {
        this.recCreateTime = recCreateTime;
    }

    public String getTenderFlag() {
        return tenderFlag;
    }

    public void setTenderFlag(String tenderFlag) {
        this.tenderFlag = tenderFlag;
    }

    public String getSeq() {
        return seq;
    }

    public void setSeq(String seq) {
        this.seq = seq;
    }

    public String getReCognizanceNo() {
        return reCognizanceNo;
    }

    public void setReCognizanceNo(String reCognizanceNo) {
        this.reCognizanceNo = reCognizanceNo;
    }

    public String getResponseTime() {
        return responseTime;
    }

    public void setResponseTime(String responseTime) {
        this.responseTime = responseTime;
    }

    public String getExchangeNo() {
        return exchangeNo;
    }

    public void setExchangeNo(String exchangeNo) {
        this.exchangeNo = exchangeNo;
    }

    public String getDealerAssistantCode() {
        return dealerAssistantCode;
    }

    public void setDealerAssistantCode(String dealerAssistantCode) {
        this.dealerAssistantCode = dealerAssistantCode;
    }

    public String getRefundMentNo() {
        return refundMentNo;
    }

    public void setRefundMentNo(String refundMentNo) {
        this.refundMentNo = refundMentNo;
    }

    public String getCompanyNum() {
        return companyNum;
    }

    public void setCompanyNum(String companyNum) {
        this.companyNum = companyNum;
    }

    public String getIsBindWechat() {
        return isBindWechat;
    }

    public void setIsBindWechat(String isBindWechat) {
        this.isBindWechat = isBindWechat;
    }

    public String getTenderNo() {
        return tenderNo;
    }

    public void setTenderNo(String tenderNo) {
        this.tenderNo = tenderNo;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getSubtotalTaxed() {
        return subtotalTaxed;
    }

    public void setSubtotalTaxed(String subtotalTaxed) {
        this.subtotalTaxed = subtotalTaxed;
    }

    public String getQuotationGiveUpMemo() {
        return quotationGiveUpMemo;
    }

    public void setQuotationGiveUpMemo(String quotationGiveUpMemo) {
        this.quotationGiveUpMemo = quotationGiveUpMemo;
    }

    public String getQuotationIp() {
        return quotationIp;
    }

    public void setQuotationIp(String quotationIp) {
        this.quotationIp = quotationIp;
    }

    public List<RfqQuotationHisotryVo> getQuotationHisotrys() {
        return quotationHisotrys;
    }

    public void setQuotationHisotrys(List<RfqQuotationHisotryVo> quotationHisotrys) {
        this.quotationHisotrys = quotationHisotrys;
    }

    public RfqQuotationVo getQuotation() {
        return quotation;
    }

    public void setQuotation(RfqQuotationVo quotation) {
        this.quotation = quotation;
    }
}
